package com.xunxi.mimi.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.xunxi.mimi.app_base.R;
import com.xunxi.mimi.widget.LoadingProgressBar;


public class LoadingDialog extends Dialog {

    private Context mContext;

	private LoadingProgressBar mProgressBar;

	public LoadingDialog(Context context) {
		super(context, R.style.LoadingDialog);
		mContext = context;
		init(context);
	}

	public LoadingDialog(Context context, int themeResId) {
		super(context, themeResId);
		init(context);
	}

	private void init(Context context) {
		View dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_loading, null);
		mProgressBar = (LoadingProgressBar) dialogView.findViewById(R.id.loading_gv);
		setContentView(dialogView);
		setCanceledOnTouchOutside(true);
	}

	@Override
	public void show() {
		super.show();
		if (mProgressBar != null) {
			mProgressBar.setVisibility(View.VISIBLE);
		}
	}

	@Override
	public void dismiss() {
		if (mProgressBar != null){
			mProgressBar.setVisibility(View.GONE);
		}
		super.dismiss();
	}
}








































































































































